#include <stdio.h>

int main() {
    int a = 0, b = 0, c = 0, d = 0, e = 0, f = 0;
    char x = 0;
    while (x != '@') {
        scanf("%c", &x);
        switch (x) {
            case '(':
                a++;
                break;
            case ')':
                b++;
                break;
            case '[':
                c++;
                break;
            case ']':
                d++;
                break;
            case '{':
                e++;
                break;
            case '}':
                f++;
                break;
            default:
                break;
        }
    }
    if (e != f)
        printf("{}");
    if (c != d)
        printf("[]");
    if (a != b)
        printf("()");
    if (a == b && c == d && e == f)
        printf("NULL");
    return 0;
}
